<template>
  <div>
    <!--    <van-nav-bar-->
    <!--        title="其他内容"-->
    <!--        left-text="返回"-->
    <!--        left-arrow-->
    <!--        :safe-area-inset-top="true"-->
    <!--        @click-left="onClickLeft"-->
    <!--    />-->
    <div class="other-bg">

      <!--    <router-link to="/Report">-->
      <!--      <van-image class="report" width="80" height="80" :src="require('@/assets/img/icon-22.png')" />-->
      <!--    </router-link>-->

      <van-row class="backg">
        <van-col span="24" class="otherbg-c">
          <van-image class="" width="60" height="60" v-bind:src="avatar" />
          <span>{{userName}}</span>
          <span style="font-size: 13px;margin-top: 15px;padding-left: 50px" >{{deptName}}</span>
          <span style="font-size: 13px;margin-top: 15px">{{userType}}</span>
        </van-col>
      </van-row>

      <van-row class="backg">
        <van-col span="24" class="title-column">
          <van-image class="title-img" width="10" height="12" :src="require('@/assets/img/column-icon.png')" />
          增补申请
        </van-col>

        <van-col span="24" class="backg-c event">
          <router-link to="/Report" class="other-line">
            <van-col span="18" class="font-14">点位增补建议</van-col>
            <van-col span="6" class="font-14 arrow-fr" ><van-icon name="arrow" /></van-col>
          </router-link>
          <router-link to="/Report" class="other-line">
            <van-col span="18" class="font-14">非机动车停放区增设申请</van-col>
            <van-col span="6" class="font-14 arrow-fr" ><van-icon name="arrow" /></van-col>
          </router-link>
          <router-link to="/Approvalist" class="">
              <van-col span="18" class="font-14">停放区增设申请审批</van-col>
            <van-col span="6" class="font-14 arrow-fr"><van-icon name="arrow" /></van-col>
          </router-link>
        </van-col>

      </van-row>

      <van-row class="backg">
        <van-col span="24" class="title-column">
          <van-image class="title-img" width="10" height="12" :src="require('@/assets/img/column-icon.png')" />
          其它
        </van-col>

        <van-col span="24" class="backg-c event">
          <van-col span="24" class="other-line">
            <van-col span="18" class="font-14">版本号</van-col>
            <van-col span="6" class="font-14 arrow-fr other-textd">1.0</van-col>
          </van-col>
          <van-col span="24">
            <van-col span="18" class="font-14" @click="qing">清除缓存</van-col>
            <van-col span="6" class="font-14 arrow-fr other-textd">{{huan}}MB</van-col>
          </van-col>
        </van-col>

        <van-col span="24">

            <van-button class="van-button--plain" @click="tui" type="info" block>退出登陆</van-button>

        </van-col>
      </van-row>

      <Nav />
    </div>
  </div>
</template>

<script>
import Nav from "@/components/Nav.vue";
import {Toast} from "vant";
export default {
  data() {
    return {
      userName: '默认名称',
      deptName:localStorage.getItem("deptName"),
      userType:localStorage.getItem("userType"),
      avatar:'',
      huan:0,
    };
  },
  created() {
    this.username = localStorage.getItem("userName");
    this.deptName=localStorage.getItem("deptName"),
        this.userType=localStorage.getItem("userType"),
    this.avatar=localStorage.getItem('avatar');
    console.log("用户头像:=>"+this.avatar);
    this.huan=localStorage.length;
  },

  methods: {
    onClickLeft(){
      this.$router.go(-1);
    },
    qing(){
       this.huan=0;
       Toast("清除成功！");
    },
    tui(){
      localStorage.removeItem("userId");
      this.$router.push("/");
    },
  },
  components:{
    Nav
  },
  mounted:function(){

    this.userName = localStorage.getItem("userName");
  }
};
</script>

<style scoped>
.other-bg{
  background-color: #f0f3f8;
  height: 100%;
}
.other-line{
  border-bottom: 1px solid #f2f2f2;
  display: inline-block;
  width: 100%;
  padding-bottom: 5px;
}
.event{
  margin: 15px 0;
}

.otherbg-c{
  background-color: #5884f5;
  border-radius: 8px;
  padding: 10px;
}
.otherbg-c .van-image{
  float: left;
}
.otherbg-c span{
  margin-left: 10px;
  color: #fff;
  font-size: 18px;
  float: left;
  line-height: 60px;
}
.other-textd{
  color: #999;
}
</style>